#include "QLog.h"
#include <stdarg.h>
#include <iostream>
using namespace std;

/**/
void QLog::Log(QLog::Level logLevel, const char* fmt, ...)
{
    char FmtBuff[1000] = "";
    va_list argList;
    va_start(argList, fmt);
    vsprintf_s(FmtBuff, fmt, argList);
    va_end(argList);
    
    if (logLevel == QLog::LError)
        cout << "\033[31m";
    else if (logLevel == QLog::LWarning)
        cout << "\033[33m";
    else if (logLevel == QLog::LNotice)
        cout << "\033[32m";
    else
        cout << "";
    cout << FmtBuff << "\033[0m" << endl;
}